package com.qf.controller;

import com.qf.common.vo.R;
import com.qf.entity.User;
import com.qf.service.intf.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @description: cool新闻
 * @author: No1
 * @create: 2020-11-30 11:33:07
 */
@RestController
@RequestMapping("/api/user")
public class UserController {
    @Autowired
    private UserService userService;
    //新增
    @PostMapping("/add.do")
    public R save(@RequestBody User user){
        return userService.save(user);
    }
    //删除
    @DeleteMapping("/del.do")
    public R del(int id){
        return userService.delById(id);
    }
    //查询
    @GetMapping("/all.do")
    public R all(){
        return userService.all();
    }
}